﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Child xiaoming = new Child();//实例化一个对象，其中new Child()中的函数为类的构造方法；
            xiaoming._age = 23;
            xiaoming.Height = 170;
            xiaoming._name = "xiaoming";
            xiaoming._sex = "man";
            xiaoming.PlayBall();
            xiaoming.PlayBall("badi");
            Console.Write("我叫"+xiaoming._name+",我的身高是"+xiaoming.Height);
            Console.WriteLine();


            Child xiaoli = new Child("xiaoli", "girl"); //实例化一个对象,调用含参构造函数
            Console.Write("我叫" + xiaoli._name + ",我的性别是" + xiaoli._sex);
            Console.WriteLine();


            Child xiaobai = new Child() { _name = "xiaobai", _sex = "女" };  //对象初始化器
            Console.Write("我叫" + xiaobai._name + ",我的性别是" + xiaobai._sex);


            Console.Read();

            Console.WriteLine("分支1.");
        }
    }


}
